import request from '@/config/axios'

export interface RoleVO {
  id: number
  name: string
  code: string
  sort: number
  status: number
  type: number
  dataScope: number
  dataScopeDeptIds: number[]
  createTime: Date
}

export interface UpdateStatusReqVO {
  id: number
  status: number
}

// 获取人员在项目中的角色
export const getProjectMemberRole = async (params) => {
  return await request.get({ url: '/project/member/role', params })
}

//查询提测单列表
export const getTestformList = async (params) => {
  return await request.get({
    url: '/testManager/testSuite/getTestRequestFormList', params
  })
}

//查询测试类型列表
export const getTypeList = async () => {
  return await request.get({
    url: '/testManager/testSuite/getTestType'
  })
}

//查询需求树
export const getDemandTree = async (params) => {
  return await request.get({
    url: '/testManager/testSuite/getFunctionListById', params
  })
}

// 查询用例列表
export const getPage = async (params: PageParam) => {
  return await request.get({ url: '/testManager/testSuite/getAllcase', params })
}

// 新增用例
export const createUseCase = async (data) => {
  return await request.post({
    url: '/testManager/testSuite/addTestCase', data
  })
}

// 编辑用例
export const updateUseCase = async (data) => {
  return await request.post({
    url: '/testManager/testSuite/editTestCase', data
  })
}

// 查看用例
export const viewUseCase = async (id: number) => {
  return await request.get({ url: '/testManager/testSuite/findTestCaseById?id=' + id })
}

// 删除用例
export const deleteUseCase = (id: number) => {
  return request.get({ url: '/testManager/testSuite/deleteTestCaseById?id=' + id })
}

//查询用例集树
export const getTestboxTree = async (params) => {
  return await request.get({
    url: '/testManager/testSuite/tree', params
  })
}

// 新增用例集
export const createTestbox = async (data) => {
  return await request.post({
    url: '/testManager/testSuite/create', data
  })
}

// 编辑用例集
export const updateTestbox = async (data) => {
  return await request.post({
    url: '/testManager/testSuite/edit', data
  })
}

// 删除用例集
export const deleteTestbox = (id: number) => {
  return request.delete({ url: '/testManager/testSuite/delete?id=' + id })
}

